package org.smart4j.aopdemo.spring;

import org.smart4j.aopdemo.simple.Greeting;
import org.smart4j.aopdemo.simple.GreetingImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AOPConfigClient {

    public static void main(String[] args){
        ApplicationContext ctx = new ClassPathXmlApplicationContext("/beans.xml");
//        Greeting greeting = (Greeting) ctx.getBean("greetingProxy");
//        greeting.sayHello("liuzx");
//
//        greeting.sayThrow();

        GreetingImpl greeting1 = (GreetingImpl) ctx.getBean("greetingProxy1");
        greeting1.sayHello("Jack");
        Apology apology = (Apology) greeting1;
        apology.saySorray("Jack");

    }

}
